<domain type='{{ libvirt_domain_type }}'>
  <name>{{ item.name }}</name>
  <memory unit='MiB'>{{ flavors[item.flavor].memory }}</memory>
  <vcpu>{{ flavors[item.flavor].vcpu }}</vcpu>

  {{baremetal_vm_xml|default('')}}

  <os>
{% if libvirt_boot_mode == 'uefi' %}
    <type arch='{{ libvirt_arch }}' machine ='q35'>hvm</type>
    <loader readonly="yes" secure="no" type="pflash">/usr/share/edk2/ovmf/OVMF_CODE.secboot.fd</loader>
    <nvram template='/usr/share/edk2/ovmf/OVMF_VARS.fd'/>
{% else %}
    <type arch='{{ libvirt_arch }}'>hvm</type>
{% endif %}
    <boot dev='network'/>
    <bootmenu enable='no'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <cpu mode='host-passthrough'/>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <disk type='volume' device='disk'>
      <driver name='qemu' type='qcow2' cache='unsafe'/>
      <source pool='{{ libvirt_volume_pool }}' volume='{{ item.name }}.qcow2'/>
      <target dev='{{ libvirt_diskdev }}' bus='{{ libvirt_diskbus }}'/>
    </disk>
{% for network in networks %}
{% if ( (network.force_ovc|default(false)|bool) or (network.forward_mode is not defined) or
        (network.forward_mode is defined and network.forward_mode != 'nat') ) %}
    <interface type='bridge'>
      <mac address='{{ node_mac_map.get(item.name).get(network.name) }}'/>
      <source bridge='{{ network.bridge }}'/>
      <model type='{{ overcloud_libvirt_nic_model }}'/>
{% if network.virtualport_type is defined %}
      <virtualport type='{{ network.virtualport_type }}'/>
{% endif %}
    </interface>
{% endif %}
{% endfor %}
    <serial type='pty'/>
    <console type='pty'/>

{% if enable_vnc_console|bool %}
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='-1' autoport='yes'/>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
    </video>
{% endif %}

    {{baremetal_vm_device_xml|default('')}}

  </devices>
</domain>
